<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <div data-num="1" onclick="fn(e)">
      hhhhh
    </div>
  </body>
  <script>
    var fn = e => {
      console.log(e);
    };
    /**
     * @param {number[]} nums
     * @return {boolean}
     */
    var containsDuplicate = function(nums) {
      let falg = false;
      nums.sort((a, b) => {
        // 先排序
        return a - b;
      });
      for (let i = 0; i < nums.length; i++) {
        if (nums[i] == nums[i + 1]) {
          return (falg = true);
        }
      }
      return falg;
    };
    console.log(containsDuplicate([1, 1, 1, 3, 3, 4, 3, 2, 4, 2]));
  </script>
</html>
